/**
 * Project: complex.quartz
 * 
 * File Created at 2010-6-29
 * $Id$
 * 
 * Copyright 2008 Alibaba.com Croporation Limited.
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of
 * Alibaba Company. ("Confidential Information").  You shall not
 * disclose such Confidential Information and shall use it only in
 * accordance with the terms of the license agreement you entered into
 * with Alibaba.com.
 */
package com.complex.quartz.spring;

import java.util.concurrent.TimeUnit;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @description:XXX
 * @author gaoliang
 * @date 2010-6-29
 * @version 1.0
 */
public class TestJob {
    private static int i = 0;

    public void print() {
        System.out.format("this is testjob:%d \n", i++);
    }

    public static void main(String[] args) {
        ApplicationContext context = new ClassPathXmlApplicationContext("/service-bean.xml");

        //使用BeanFactory不行,因为bean没有初始化,但testJob.print();之后还是不行?
        //        BeanFactory beanFactory = new XmlBeanFactory(new ClassPathResource("/service-bean.xml"));
        //        TestJob testJob = (TestJob)beanFactory.getBean("testJob");
        //        testJob.print();
//        try {
//            TimeUnit.SECONDS.sleep(50);
//        } catch (InterruptedException e) {
//            // TODO Auto-generated catch block
//            e.printStackTrace();
//        }

    }
}
